home *** CD-ROM | disk | FTP | other *** search
- Path: dispatch.news.demon.net!demon!pcf.spectratek.co.uk
- From: Dean Darlison <dean_darlison@spectratek.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Check if a file exists?
- Date: Wed, 17 Apr 1996 07:50:26 -0700
- Organization: Spectra-Tek UK Ltd
- Message-ID: <31750532.318@spectratek.co.uk>
- References: <4kp7pg$upe@news-s01.ny.us.ibm.net> <317261E6.31D0@spectratek.co.uk> <829569968snz@genesis.demon.co.uk> <3172B2E8.7D70@willows.com>
- NNTP-Posting-Host: pcf.spectratek.co.uk
- X-NNTP-Posting-Host: pcf.spectratek.co.uk
- X-Mailer: Mozilla 2.0 (Win16; I)
- MIME-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
-
- Tarang Deshpande wrote:
- >
- > Lawrence Kirby wrote:
- > >
- > > In article <317261E6.31D0@spectratek.co.uk>
- > > dean_darlison@spectratek.co.uk "Dean Darlison" writes:
- > >
- > > >man access
- > >
- > > If that works on your system then the contents should tell you that this
- > > function is inappropriate for the question asked.
- > >
- > > --
- > > -----------------------------------------
- > > Lawrence Kirby | fred@genesis.demon.co.uk
- > > Wilts, England | 70734.126@compuserve.com
- > > -----------------------------------------
- >
- > Under SUNOS 5.4, LINUX 1.1.46 and conforming to SVID, AT&T, POSIX,
- > X/OPEN, and BSD 4.3
- >
- > #include <unistd.h>
- > int access (const char *path, int amode)
- >
- > where amode is F_OK then the function is used to test for existance.
-
- I beg to differ. To determine if a file exists without usinf fopen.
-
- from man access:
- int access(const char *path, int access_mode);
-
- with an access mode of 0 (zero). This just checks for the existance of
- the file specified.
-
- Cheers,
- Dean.
- --
- Dean.A.Darlison
- Spectra-Tek UK Ltd
- email: dean_darlison@spectratek.co.uk
- Tel: 01653-695551
-